package com.flextribe.util
{
	import flash.utils.describeType;
	
	public class Enum
	{
		protected static function initEnumConstants(inType:*):void
		{
			var type:XML = describeType(inType);
			//var id:int = 0;
			for each(var constant:XML in type.constant)
			{
				inType[constant.@name].label = constant.@name;
				inType.constants.push(inType[constant.@name]);
			}
			for each(var variable:XML in type.variable)
			{
				inType[variable.@name].label = variable.@name;
			}
		}

		protected static var locked:Boolean = false;

		private var _label:String;
		public function get label():String{
			return _label;
		}
		public function set label(value:String):void{
			_label = value;
		}

		private var _id:int;
		
		public function get id():int{
			return _id;
		}
		public function set id(value:int):void{
			_id = value;
		}
		
		public function Enum(id:int=0)
		{
			_id = id;
		}
		public function toString():String{
			return label+" "+id;
		}
		

	}
}

